﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Chizx.Web.e.Master
{
    public partial class Index : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
            if (null == Session["UserEntity"])
            {
                Response.Redirect("/e/Login.aspx");
            }
            else
            {
                Chizx.Model.UserModel vuser = new Chizx.Model.UserModel();
                Chizx.Model.MessageModel mmsg = new Chizx.Model.MessageModel();
                Chizx.BLL.MessageBll mbll = new Chizx.BLL.MessageBll();
                vuser = (Chizx.Model.UserModel)Session["UserEntity"];
                zUserName.Text = vuser.zu_name;
                //获取当前在线用户账户信箱中的未读信件数目
                System.Text.StringBuilder strWhere = new System.Text.StringBuilder();
                strWhere.AppendFormat("zu_id='{0}'", vuser.zu_id);
                strWhere.AppendFormat(" and zmsg_status='{0}'", "m0");
                zMsgNum.Text = mbll.GetRecordCount(strWhere.ToString()).ToString();
            }
        }
    }
}